package com.kaishengit.pojo;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Table(name="t_goal")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class Goal {
	
	private String id;
	private String name;
	private String content;
	private String createtime;
	
	private int goalrates;
	
	private User user;
	private Project project; 
	private Set<Task> taskList;
	
	
	@Id
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getCreatetime() {
		return createtime;
	}
	public void setCreatetime(String createtime) {
		this.createtime = createtime;
	}
	
	@ManyToOne
	@JoinColumn(name="userid")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	@ManyToOne
	@JoinColumn(name="projectid")
	public Project getProject() {
		return project;
	}
	public void setProject(Project project) {
		this.project = project;
	}
	
	@OneToMany
	@JoinColumn(name="goalid")
	public Set<Task> getTaskList() {
		return taskList;
	}
	public void setTaskList(Set<Task> taskList) {
		this.taskList = taskList;
	}
	@Transient
	public int getGoalrates() {
		return goalrates;
	}
	public void setGoalrates(int goalrates) {
		this.goalrates = goalrates;
	}
}
